package com.example.prison.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.prison.entity.PushRecord;
import com.example.prison.service.PushRecordService;
import com.example.prison.mapper.PushRecordMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author jiang
* @description 针对表【push_record】的数据库操作Service实现
* @createDate 2023-06-13 09:32:29
*/
@Service
public class PushRecordServiceImpl extends ServiceImpl<PushRecordMapper, PushRecord>
    implements PushRecordService{

    @Autowired
    private PushRecordMapper pushRecordMapper;

    @Override
    public PageInfo<PushRecord> get(int pageNumber, int pageSize, String alarmLevel, String pushPersonnel, String beginTime, String endTime) {
        PageHelper.startPage(pageNumber, pageSize);
        return new PageInfo<>(pushRecordMapper.get(alarmLevel, pushPersonnel, beginTime, endTime));
    }

    @Override
    public int add(PushRecord record) {
        pushRecordMapper.add(record);
        return 1;
    }

    @Override
    public PushRecord getById(Integer id) {
        return pushRecordMapper.getById(id);
    }


}




